﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width" />
    <title>生产管理粗纱机</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet" />
    <script src="../Content/scripts/jquery-1.11.1.min.js"></script>
    <link href="../Content/styles/font-awesome.min.css" rel="stylesheet" />
    <link href="../Content/scripts/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
    <script src="../Content/scripts/plugins/jquery-ui/jquery-ui.min.js"></script>
    <script src="../js/jquery.easing.1.3.js"></script>
    <link href="../Content/scripts/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="../Content/scripts/bootstrap/bootstrap.min.js"></script>
    <link href="../Content/scripts/plugins/jqgrid/jqgrid.css" rel="stylesheet" />
    <link href="../Content/adminLTE/css/index.css" rel="stylesheet" />
    <link href="../Content/styles/learun-ui.css" rel="stylesheet" />
    <script src="../Content/scripts/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../Content/scripts/plugins/jqgrid/jqgrid.min.js"></script>
    <script src="../Content/scripts/plugins/tree/tree.js"></script>
    <script src="../Content/scripts/plugins/validator/validator.js"></script>
    <script src="../Content/scripts/plugins/dialog/dialog.js"></script>
    <script src="../Content/scripts/utils/learun-ui.js"></script>
    <script src="../Content/scripts/utils/learun-form.js"></script>
    <link href="../Content/scripts/plugins/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
    <script src="../Content/scripts/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="../Content/scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script src="../Content/scripts/plugins/layout/jquery.layout.js"></script>
    <script src="../My97DatePicker/WdatePicker.js"></script>
    <script src="../js/highcharts.js"></script>
    <script src="../js/highcharts-3d.js"></script>
    <script src="../js/no-data-to-display.src.js"></script>
    <script src="../js/getUrlParam.js"></script>
    <script src="MFGjs.js"></script>
    <script src="CushaJS.js"></script>


    <style type="text/css">
        body {
            margin: 0px;
            margin-top: 10px;
        }

        .form .formTitle {
            width: 150px;
            font-size: 20px;
            padding-bottom: 35px;
        }

        .form .formValue {
            padding-bottom: 25px;
            width: 150px;
        }

        .valuestyle {
            font-size: 20px;
        }

        #title {
            font-size: 30px;
            text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
        }

        #time {
            font-size: 20px;
            float: right;
            line-height: 50px;
            right: 40px;
            position: fixed;
            color: #65b540;
        }

        @media screen and (min-width:1281px) and (max-width:1440px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }

        @media screen and (max-width:1024px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }



        @media screen and (min-width:1025px) and (max-width:1280px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }

        #info {
            float: right;
            color: #ff0000;
            font-size: 9px;
        }

        a {
            color: skyblue;
            text-decoration: none;
            cursor: pointer;
        }

        span {
            border-radius: 100px;
        }

        .highcharts-subtitle {
            left: 260px;
        }

            .highcharts-subtitle a {
                font-size: 20px;
            }

        #tipStart, #tipEnd {
            opacity: 0;
        }

        /*#container {
            width: 1500px;
            margin: 0 auto;
        }*/
        #kaitingcehtongjitu, #guzhangtongjitu, #weisha_guzhangtongjitu {
            opacity: 0;
            margin-top: 10px;
            /*width: 1500px;*/
            margin: 0 auto;
        }

        #kaitingcehtongjitu, #weisha_kaitingcehtongjitu {
            float: left;
            width: 100%;
        }

        #kaitingcehtongjipie, #weisha_kaitingcehtongjipie {
            opacity: 0;
            float: left;
        }

        #westpanel, #centerpanel, #shengchanwanchengpie, #weishawestpanel, #weishacenterpanel {
            opacity: 0;
        }
    </style>
</head>

<body>
    <!--<div id="ajax-loader" style="cursor: progress; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: #fff; z-index: 10000; overflow: hidden;">
        <img src="../Content/images/ajax-loader.gif" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;" />
    </div>-->

    <div style="text-align: center; height: 50px;">
        <span id="title">生产信息</span>
        <span id="time"></span>
    </div>
    <ul id="myTab" class="nav nav-tabs">
        <li class="active dropdown">
            <a href="#" id="home" data-toggle="dropdown" class="dropdown-toggle">
                基本信息<b class="caret"></b>
            </a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="home">
                <li>
                    <a href="#cushaji" tabindex="-1" data-toggle="tab">
                        粗纱机
                    </a>
                </li>
                <li>
                    <a href="#weishaji" tabindex="-1" data-toggle="tab">
                        尾纱机
                    </a>
                </li>
            </ul>
        </li>
        <li class="dropdown">
            <a href="#" id="myTabDrop" class="dropdown-toggle"
               data-toggle="dropdown">
                粗纱监视 <b class="caret"></b>
            </a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop">
                <li>
                    <a href="#shishijilu" tabindex="-1" data-toggle="tab">
                        工艺参数
                    </a>
                </li>
                <li>
                    <a href="#dantaijianshi" tabindex="-1" data-toggle="tab">
                        单台监视
                    </a>
                </li>
                <li>
                    <a href="#kaitingche" tabindex="-1" data-toggle="tab">
                        开停车记录
                    </a>
                </li>

                <li>
                    <a href="#guzhangtongji" tabindex="-1" data-toggle="tab">
                        故障分析统计
                    </a>
                </li>
            </ul>
        </li>
        <li class="dropdown">
            <a href="#" id="yuancheng" data-toggle="dropdown" class="dropdown-toggle">
                远程连接<b class="caret"></b>
            </a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="yuancheng">
                <li>
                    <a href="https://hangzhou.gatemanager.cn/admin" tabindex="-1" target="view_window">
                        西肯麦
                    </a>
                </li>
                <li>
                    <a href="https://remonde.gatemanager.cn/admin" tabindex="-1" target="view_window">
                        远眸
                    </a>
                </li>
                <li>
                    <a href="myprotocol://">
                        测试
                    </a>
                </li>
            </ul>
        </li>
        <li class="dropdown">
            <a href="#" id="myTabDrop1" class="dropdown-toggle"
               data-toggle="dropdown">
                尾纱监视 <b class="caret"></b>
            </a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop1">
                <li>
                    <a href="#weishajianshi" tabindex="-1" data-toggle="tab">
                        监视信息
                    </a>
                </li>
                <li>
                    <a href="#weishakaitingche" tabindex="-1" data-toggle="tab">
                        开停车记录
                    </a>
                </li>
                <li>
                    <a href="#weishaguzhang" tabindex="-1" data-toggle="tab">
                        故障统计
                    </a>
                </li>
            </ul>
        </li>
    </ul>

    <div id="myTabContent" class="tab-content">
        <!--粗纱基本信息-->
        <div class="tab-pane fade in active" id="cushaji">
            <div class="panel-Title">
                粗纱机生产目标产量与完成产量
            </div>
            <table id="tb_cushashengchanwancheng"></table>

            <div class="ui-layout" id="layout" style="width:100%;">
                <div class="ui-layout-west" id="westpanel">
                    <div class="west-Panel">
                        <div class="panel-Title">粗纱机生产完成统计</div>
                        <div class="title-search" style="margin-top: 5px;">
                            <table>
                                <tr>
                                    <td style="padding-left: 5px;">
                                        <span>选择纺纱品种：</span>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <select class="form-control" id="cushakindlist" style="width: 100px;">

                                        </select>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="shengchanwanchengpie"></div>
                    </div>
                </div>

                <div class="ui-layout-center" id="centerpanel">
                    <div class="center-Panel">
                        <div class="panel-Title">粗纱机生产完成统计</div>
                        <!--<div class="title-search" style="margin-top: 5px;">
                            <table>
                                <tr>
                                    <td style="padding-left: 5px;">
                                        <span>选择纺纱品种：</span>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <select class="form-control" id="cushakindlist1" style="width: 100px;"></select>
                                    </td>
                                </tr>
                            </table>
                        </div>-->
                        <div id="shengchanwanchengcolumn"></div>
                    </div>
                </div>
            </div>

        </div>

        <!--尾纱基本信息-->
        <div class="tab-pane fade" id="weishaji">
            <div class="panel-Title">
                尾纱机基本信息
            </div>
            <table id="tb_weishajibenxinxi"></table>

            <div class="ui-layout" id="weishalayout" style="width:100%;">
                <div class="ui-layout-west" id="weishawestpanel">
                    <div class="west-Panel">
                        <div class="panel-Title">尾纱清洁目标数量统计</div>

                        <div id="weishamubiaowanchengpie"></div>
                    </div>
                </div>

                <div class="ui-layout-center" id="weishacenterpanel">
                    <div class="center-Panel">
                        <div class="panel-Title">尾纱清洁目标数量统计</div>

                        <div id="weishamubiaowanchengcolumn"></div>
                    </div>
                </div>
            </div>
        </div>

        <!--粗纱工艺参数-->
        <div class="tab-pane fade" id="shishijilu">
            <div class="panel-Title">
                纺纱工艺参数
            </div>
            <table id="tb_cusha"></table>

            <div class="panel-Title" style="margin-top: 50px;">
                落纱工艺参数
            </div>
            <table id="tb_luoshaparm"></table>
        </div>

        <!--粗纱单台数据-->
        <div class="tab-pane fade" id="dantaijianshi">
            <div class="panel-Title">
                粗纱单台监视
            </div>
            <div class="titlePanel">
                <div class="title-search">
                    <table>
                        <tr>
                            <td style="padding-left: 5px;">
                                <span>选择粗纱台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="equnolist" style="width: 100px;"></select>
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <table id="dantaijianshitable"></table>

            <div class="ui-layout" id="zhenxiantulayout" style="width:100%;">
                <div class="ui-layout-west" id="zhenxiantuwestpanel">
                    <div class="west-Panel">
                        <div class="panel-Title">实时统计信息图</div>
                        <div class="title-search" style="margin-top: 20px;">
                            <table>
                                <tr>
                                    <td style="padding-left: 5px;">
                                        <span>选择粗纱台号：</span>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <select class="form-control" id="equnolist1" style="width: 100px;"></select>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <span>参数类型：</span>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <select class="form-control" id="parmlist" style="width: 200px;">
                                            <option value="1" selected>锭翼电机速度</option>
                                            <option value="2">筒管电机速度</option>
                                            <option value="3">罗拉电机速度</option>
                                            <option value="4">升降电机速度</option>
                                            <option value="5">龙筋位置</option>
                                        </select>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <a id="btn_currentLuosha" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;当前落纱</a>
                                    </td>
                                    <td style="padding-left: 20px;">
                                        <span id="tipStart">当前落纱开始时间：</span>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <label id="tipStartValue"></label>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <span id="tipEnd">当前落纱层数：</span>
                                    </td>
                                    <td style="padding-left: 5px;">
                                        <label id="tipEndValue"></label>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="zhexiantu" style=" margin-top: 20px;"></div>
                    </div>
                </div>

                <div class="ui-layout-center" id="zhexiantucenterpanel">
                    <div class="center-Panel">
                        <div class="panel-Title">停车分析饼图</div>
                        <div class="title-search" style="margin-top: 20px;">

                        </div>
                        <div id="tingcehfenxibingtu" style="margin-top:73px;"></div>
                    </div>
                </div>
            </div>
        </div>

        <!--开停车记录NEW-->
        <div class="tab-pane fade" id="kaitingche">
            <div class="panel-Title">
                开停车记录
            </div>
            <div class="titlePanel" style="border-bottom: 1px solid #ccc;">
                <div class="title-search">
                    <table>
                        <tr>
                            <td style="padding-left: 5px;">
                                <span>选择粗纱台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="taihaolist" style="width: 100px;">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开停状态：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="kaitingcheselect" style="width: 100px;">
                                    <option value="0">停车</option>
                                    <option value="1">开车</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>班次选择：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="banciselect" style="width: 100px;">
                                    <option value="">请选择</option>
                                    <option value="1">A班</option>
                                    <option value="2">B班</option>
                                    <option value="3">C班</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开始时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="Kaiting_StartTime" type="text" class="form-control" onclick="WdatePicker({ lang: 'zh-cn', maxDate: '#F{$dp.$D(\'Kaiting_EndTime\')||\'%y-%M-%d\'}', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <span>结束时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="Kaiting_EndTime" type="text" class="form-control" onclick="WdatePicker({ lang: 'zh-cn', minDate: '#F{$dp.$D(\'Kaiting_StartTime\')}', maxDate: '%y-%M-%d', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_SearchKaitingcehg" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <table id="tb_cushakaitingche"></table>

            <!--开停车详细信息-->
            <div class="panel-group" id="accordion" style="margin-top: 20px;">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" data-parent="#accordion"
                               href="#collapseexample">
                                开停车详细信息
                            </a>
                        </h4>
                    </div>
                    <div id="collapseexample" class="panel-collapse collapse in">
                        <div class="panel-body">
                            <table id="tb_kaitingcehdetail"></table>
                        </div>
                    </div>
                </div>
            </div>
            <div id="kaitingcehtongjitu"></div>

            <div id="kaitingcehtongjipie"></div>
        </div>

        <!--故障统计分析-->
        <div class="tab-pane fade" id="guzhangtongji">
            <div class="panel-Title">
                故障统计分析
            </div>
            <div class="titlePanel">
                <div class="title-search">
                    <table>
                        <tr>

                            <td style="padding-left: 5px;">
                                <span>选择台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="guzhangtongjiTaihaolist" style="width: 100px;">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开始时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="guzhangtongjiStartTime" type="text" class="form-control input-datepicker" onclick="WdatePicker({ lang: 'zh-cn', maxDate: '#F{$dp.$D(\'guzhangtongjiEndTime\')||\'%y-%M-%d\'}', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <span>结束时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="guzhangtongjiEndTime" type="text" class="form-control input-datepicker" onclick="WdatePicker({ lang: 'zh-cn', minDate: '#F{$dp.$D(\'guzhangtongjiStartTime\')}', maxDate: '%y-%M-%d', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_guzhangtongji" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <table id="gridTabletongji"></table>

            <div id="guzhangtongjitu"></div>
        </div>

        <!--尾纱监视信息-->
        <div class="tab-pane fade" id="weishajianshi">
            <div class="panel-Title">
                尾纱监视信息
            </div>
            <table id="tb_weisha_jianshi"></table>
        </div>

        <!--尾纱开停车记录-->
        <div class="tab-pane fade" id="weishakaitingche">
            <div class="panel-Title">
                开停车记录
            </div>
            <div class="titlePanel" style="border-bottom: 1px solid #ccc;">
                <div class="title-search">
                    <table>
                        <tr>
                            <td style="padding-left: 5px;">
                                <span>选择尾纱台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="weishataihaolist" style="width: 100px;">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开停状态：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="weishakaitingcheselect" style="width: 100px;">
                                    <option value="0">停车</option>
                                    <option value="1">开车</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>班次选择：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="weishabanciselect" style="width: 100px;">
                                    <option value="">请选择</option>
                                    <option value="1">A班</option>
                                    <option value="2">B班</option>
                                    <option value="3">C班</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开始时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="weishaKaiting_StartTime" type="text" class="form-control" onclick="WdatePicker({ lang: 'zh-cn', maxDate: '#F{$dp.$D(\'weishaKaiting_EndTime\')||\'%y-%M-%d\'}', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <span>结束时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="weishaKaiting_EndTime" type="text" class="form-control" onclick="WdatePicker({ lang: 'zh-cn', minDate: '#F{$dp.$D(\'weishaKaiting_StartTime\')}', maxDate: '%y-%M-%d', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_SearchweishaKaitingche" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <table id="tb_weishakaitingche"></table>

            <!--开停车详细信息-->
            <div class="panel-group" id="accordion" style="margin-top: 20px;">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" data-parent="#accordion"
                               href="#collapseexample">
                                开停车详细信息
                            </a>
                        </h4>
                    </div>
                    <div id="collapseexample" class="panel-collapse collapse in">
                        <div class="panel-body">
                            <table id="tb_weishakaitingcehdetail"></table>
                        </div>
                    </div>
                </div>
            </div>
            <div id="weisha_kaitingcehtongjitu"></div>

            <div id="weisha_kaitingcehtongjipie"></div>
        </div>

        <!--尾纱故障统计分析-->
        <div class="tab-pane fade" id="weishaguzhang">
            <div class="panel-Title">
                故障统计分析
            </div>
            <div class="titlePanel">
                <div class="title-search">
                    <table>
                        <tr>

                            <td style="padding-left: 5px;">
                                <span>选择台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="weisha_guzhangtongjiTaihaolist" style="width: 100px;">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开始时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="weisha_guzhangStartTime" type="text" class="form-control input-datepicker" onclick="WdatePicker({ lang: 'zh-cn', maxDate: '#F{$dp.$D(\'weisha_guzhangEndTime\')||\'%y-%M-%d\'}', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <span>结束时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="weisha_guzhangEndTime" type="text" class="form-control input-datepicker" onclick="WdatePicker({ lang: 'zh-cn', minDate: '#F{$dp.$D(\'weisha_guzhangStartTime\')}', maxDate: '%y-%M-%d', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_weishaguzhangtongji" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <table id="weisha_gridTabletongji"></table>

            <div id="weisha_guzhangtongjitu"></div>
        </div>

    </div>

    <div id="loading_background" class="loading_background" style="display: none;"></div>
    <div id="loading_manage" style="display: none;">
        正在拼了命为您加载…
    </div>
    <script>

        var IDs = UrlParam.paramValues("ID");
        var ID = IDs[0];
        //var width = "";
        var height = "";
        var activeTab = "#cushaji";

        $(function () {
            getTime();
            externallinks();
            $.mfgjs.getCustomInfoByID(ID);
            $.Cushajs.initFangshaKind(ID);
            $.Cushajs.inittb_cushashengchanwancheng(ID, $("#time").text());
            
            height = $(window).height();
            $("#layout").height(height - 450);

            //layout布局
            $('#layout').layout({
                applyDemoStyles: true,
                west: {
                    size: $(window).width() * 0.6
                },
                onresize: function () {
                    $(window).resize()
                }
            });


            $("#cushakindlist").change(function () {
                var rows = $('#tb_cushashengchanwancheng').jqGrid('getRowData'); //获取当前显示的记录
                $.Cushajs.initShengchanwanchegnWest(rows);
            });

            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {

                // 获取已激活的标签页的名称
                activeTab = $(e.target).attr('href');

                if (activeTab == '#shishijilu') {
                    //1.初始化Table
                    var oTable = new TableInit();
                    oTable.Init();
                    oTable.InitLuosha();

                    //2.初始化Button的点击事件
                    var oButtonInit = new ButtonInit();
                    oButtonInit.Init();
                }
                    // 尾纱机 基本信息
                else if (activeTab == '#weishaji') {
                    $("#weishalayout").height(height - 450);

                    ////layout布局
                    $('#weishalayout').layout({
                        applyDemoStyles: true,
                        west: {
                            size: $(window).width() * 0.4
                        },
                        onresize: function () {
                            $(window).resize()
                        }
                    });

                    // 获取尾纱机 基本信息
                    $.Cushajs.initweishajibenxinxi(ID, $("#time").text());
                }

                //单台监视
                else if (activeTab == '#dantaijianshi') {

                    $("#zhenxiantulayout").height(height - 350);
                    ////layout布局
                    $('#zhenxiantulayout').layout({
                        applyDemoStyles: true,
                        west: {
                            size: $(window).width() * 0.6
                        },
                        onresize: function () {
                            $(window).resize()
                        }
                    });
                    $.Cushajs.getEquNolistByCustomerID(ID, 1);

                    //查询事件
                    $("#btn_Search").click(function () {
                        Loading(true);
                        $('#dantaijianshitable').jqGrid("clearGridData");
                        $('#dantaijianshitable').jqGrid('setGridParam', {
                            postData: {
                                Action: "initdangtaijianshidata",
                                EquNo: $('#equnolist').find('option:selected').val(),
                                TaiHao: $('#equnolist').find('option:selected').text(),
                                Time: $("#time").text()
                            },
                        }).trigger('reloadGrid');
                    });
                    //当前落纱按钮点击
                    $("#btn_currentLuosha").click(function () {
                        Loading(true);

                        $.Cushajs.initcurrentluoshaStartEnd(ID, $("#equnolist1").find("option:selected").text(), $("#time").text());

                    });
                }

                    //开停车记录
                else if (activeTab == '#kaitingche') {
                    // 设置当前时间
                    setdate();
                    $.Cushajs.getEquNolistByCustomerID(ID, 3);
                }

                    //故障统计
                else if (activeTab == '#guzhangtongji') {
                    setdate();
                    $.Cushajs.getEquNolistByCustomerID(ID, 4);

                    //查询事件
                    $("#btn_guzhangtongji").click(function () {
                        var guzhangtongjiTaihao = $("#guzhangtongjiTaihaolist").find("option:selected").text();
                        var StartTime = $("#guzhangtongjiStartTime").val();
                        var EndTime = $("#guzhangtongjiEndTime").val();

                        if (guzhangtongjiTaihao == "请选择") {
                            dialogMsg("请选择台号", 0);
                        }
                        else {
                            $.Cushajs.initdantaicushabaojingtable(ID, guzhangtongjiTaihao, StartTime, EndTime);
                            $('#gridTabletongji').jqGrid('setGridParam', {
                                postData: {
                                    Action: "initdantaicushabaojingtable",
                                    CustomerID: ID,
                                    TaiHao: guzhangtongjiTaihao,
                                    StartTime: StartTime,
                                    EndTime: EndTime
                                },
                            }).trigger('reloadGrid');
                        }
                    });
                }
                    // 尾纱 监视信息
                else if (activeTab == '#weishajianshi') {
                    //1.初始化Table
                    var oTable = new TableInit();
                    oTable.InitWeishajianshi();

                    //2.初始化Button的点击事件
                    var oButtonInit = new ButtonInit();
                    oButtonInit.Init();
                }

                    //尾纱开停车记录
                else if (activeTab == '#weishakaitingche') {
                    // 设置当前时间
                    setdate();
                    $.Cushajs.initWeiShaTiaHaoByCustomerID(ID, 1);
                }

                    // 尾纱故障统计
                else if (activeTab == '#weishaguzhang') {
                    setdate();
                    $.Cushajs.initWeiShaTiaHaoByCustomerID(ID, 2);

                    //查询事件
                    $("#btn_weishaguzhangtongji").click(function () {
                        var guzhangtongjiTaihao = $("#weisha_guzhangtongjiTaihaolist").find("option:selected").text();
                        var StartTime = $("#weisha_guzhangStartTime").val();
                        var EndTime = $("#weisha_guzhangEndTime").val();

                        if (guzhangtongjiTaihao == "") {
                            dialogMsg("请选择台号", 0);
                        }
                        else {

                            $.Cushajs.initdantaiweishabaojingtable(ID, guzhangtongjiTaihao, StartTime, EndTime);
                            $('#weisha_gridTabletongji').jqGrid('setGridParam', {
                                postData: {
                                    Action: "initdantaiweishabaojingtable",
                                    CustomerID: ID,
                                    TaiHao: guzhangtongjiTaihao,
                                    StartTime: StartTime,
                                    EndTime: EndTime
                                },
                            }).trigger('reloadGrid');
                        }
                    });
                }
            });
        });


        var TableInit = function () {
            var oTableInit = new Object();
            var time = $("#time").text();
            //初始化Table 工艺参数
            oTableInit.Init = function () {
                $('#tb_cusha').bootstrapTable({
                    //url: '../MFG/MFGCusha.ashx?Action=getshishijilulist&time=' + $("#time").text(),         //请求后台的URL（*）
                    url: '../MFG/MFGCusha.ashx?Action=getshishijilulist',
                    method: 'POST',                      //请求方式（*）
                    contentType: "application/x-www-form-urlencoded",
                    toolbar: '#toolbar',                //工具按钮用哪个容器
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: false,                   //是否显示分页（*）
                    sortable: true,                     //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    queryParams: oTableInit.queryParams, //参数
                    //queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    //pageNumber: 1,                       //初始化加载第一页，默认第一页
                    //pageSize: 10,                       //每页的记录行数（*）
                    //pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                    search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                    strictSearch: true,
                    showColumns: true,                  //是否显示所有的列
                    showRefresh: true,                  //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    //height: 600,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                    showToggle: true,                    //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,                   //是否显示父子表

                    columns: [{
                        field: 'EquNo',
                        title: '机台号',
                        sortable: true,
                        width: 100
                    }, {
                        field: 'Banben',
                        title: '版本号'
                    }, {
                        field: 'cushaniandu',
                        title: '粗纱捻度'
                    }, {
                        field: 'tongguanzhijing',
                        title: '筒管直径'
                    },
                    {
                        field: 'zhirongkuandu',
                        title: '植绒宽度'
                    }, {
                        field: 'chengxingjiaodu',
                        title: '成型角度'
                    }, {
                        field: 'fangshadongcheng',
                        title: '纺纱动程'
                    }, {
                        field: 'meicenghoudu',
                        title: '每层厚度'
                    }, {
                        field: 'juanraomidu',
                        title: '卷绕密度'
                    }, {
                        field: 'luolazhijing',
                        title: '罗拉直径'
                    }, {
                        field: 'huanxiangcengshu',
                        title: '大纱换向调节起始层数'
                    },

                    {
                        field: 'shanghuanxishu',
                        title: '大纱上换向调节系数'
                    }, {
                        field: 'xiahuanxishu',
                        title: '大纱下换向调节系数'

                    }]
                });
            };

            //初始化Table 落纱参数
            oTableInit.InitLuosha = function () {
                $('#tb_luoshaparm').bootstrapTable({
                    url: '../MFG/MFGCusha.ashx?Action=getluoshacanshu',         //请求后台的URL（*）
                    method: 'POST',                      //请求方式（*）
                    contentType: "application/x-www-form-urlencoded",
                    toolbar: '#toolbar',                //工具按钮用哪个容器
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: false,                   //是否显示分页（*）
                    sortable: true,                     //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    queryParams: oTableInit.queryParams1, //参数
                    //queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    //pageNumber: 1,                       //初始化加载第一页，默认第一页
                    //pageSize: 10,                       //每页的记录行数（*）
                    //pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                    search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                    strictSearch: true,
                    showColumns: true,                  //是否显示所有的列
                    showRefresh: true,                  //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    //height: 600,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                    showToggle: true,                    //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,                   //是否显示父子表

                    columns: [{
                        field: 'EquNo',
                        title: '机台号',
                        sortable: true,
                        width: 100
                    }, {
                        field: 'jianianquanshu',
                        title: '加捻圈数'
                    }, {
                        field: 'liutouchangdu',
                        title: '留头长度'
                    }, {
                        field: 'pantoufangshi',
                        title: '盘头方式',
                        formatter: function (value, row, index) {
                            if (value == 0) {
                                return '下盘头';
                            }
                            else if (value == 1) {
                                return '上盘头 ';
                            }
                            else if (value == 2) {
                                return '中间打箍';
                            }
                        }
                    }, {
                        field: 'luoshafangshi',
                        title: '落纱方式'
                    },
                    {
                        field: 'pantouquanshu',
                        title: '盘头圈数'
                    }, {
                        field: 'zhanglitiaojie',
                        title: '盘头张力调节'
                    }]
                });
            };

            //初始化Table 尾纱监视
            oTableInit.InitWeishajianshi = function () {
                $('#tb_weisha_jianshi').bootstrapTable({
                    url: '../MFG/MFGCusha.ashx?Action=getWeishajianshi',         //请求后台的URL（*）
                    method: 'POST',                      //请求方式（*）
                    contentType: "application/x-www-form-urlencoded",
                    toolbar: '#toolbar',                //工具按钮用哪个容器
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: false,                   //是否显示分页（*）
                    sortable: true,                     //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    queryParams: oTableInit.queryParams1, //参数
                    //queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    //pageNumber: 1,                       //初始化加载第一页，默认第一页
                    //pageSize: 10,                       //每页的记录行数（*）
                    //pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                    search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大

                    strictSearch: true,
                    showColumns: true,                  //是否显示所有的列
                    showRefresh: true,                  //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    height: 600,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                    showToggle: true,                    //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,                   //是否显示父子表

                    columns: [{
                        field: 'TaiHao',
                        title: '机台号',
                        sortable: true,
                        width: 100
                    }, {
                        field: 'xuanzhuandisu',
                        title: '旋转电机低速'
                    }, {
                        field: 'xuanzhuanzhongsu',
                        title: '旋转电机中速'
                    }, {
                        field: 'xuanzhuangaosu',
                        title: '旋转电机高速'
                    },
                    {
                        field: 'shengjiangdisu',
                        title: '升降电机低速'
                    }, {
                        field: 'shengjiangzhongsu',
                        title: '升降电机中速'
                    }, {
                        field: 'shengjianggaosu',
                        title: '升降电机高速'
                    }, {
                        field: 'quguanwei',
                        title: '取管位'
                    }, {
                        field: 'quguanweipanduan',
                        title: '取管位判断'
                    }, {
                        field: 'zhirogwei',
                        title: '植绒位'
                    }, {
                        field: 'shanghuanxiang',
                        title: '上换向位'
                    }, {
                        field: 'gongzuochushi',
                        title: '工作初始位'
                    }, {
                        field: 'maoshuawei',
                        title: '毛刷位/等待位'
                    }, {
                        field: 'fanzhuanquanshu',
                        title: '反转圈数'
                    }, {
                        field: 'zhaotoushijian',
                        title: '找头时间'
                    }, {
                        field: 'zhaotoucishu',
                        title: '找头次数'
                    }, {
                        field: 'xishashijian',
                        title: '吸纱时间'
                    }, {
                        field: 'xizhirongcishu',
                        title: '吸植绒次数'
                    }, {
                        field: 'youmianlingmin',
                        title: '有棉灵敏度'
                    }, {
                        field: 'youguanlingmin',
                        title: '有管灵敏度'
                    }, {
                        field: 'banben1',
                        title: '单锭板1版本号'
                    }, {
                        field: 'banben2',
                        title: '单锭板2版本号'
                    }, {
                        field: 'banben3',
                        title: '单锭板3版本号'
                    }, {
                        field: 'PLCbanben',
                        title: 'PLC版本号'
                    }]
                });
            };

            //得到查询的参数
            oTableInit.queryParams = function (params) {
                console.log(params);
                var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    CustomerID: ID,
                    pageSize: params.limit, //页面大小
                    offset: params.offset, //页码
                    sort: params.sort, //排序列名
                    sortOrder: params.order,//排位命令（desc，asc）
                    time: $("#time").text()
                };
                console.log(temp);
                return temp;
            };

            oTableInit.queryParams1 = function (params) {
                console.log(params);
                var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    CustomerID: ID,
                    pageSize: params.limit, //页面大小
                    offset: params.offset, //页码
                    sort: params.sort, //排序列名
                    sortOrder: params.order//排位命令（desc，asc）
                };
                console.log(temp);
                return temp;
            };

            oTableInit.queryParams2 = function (params) {
                console.log(params);
                var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    CustomerID: ID,
                    pageSize: params.limit, //页面大小
                    offset: params.offset, //页码
                    sort: params.sort, //排序列名
                    sortOrder: params.order//排位命令（desc，asc）
                };
                console.log(temp);
                return temp;
            };
            return oTableInit;
        };


        var ButtonInit = function () {
            var oInit = new Object();
            var postdata = {};

            oInit.Init = function () {
                //初始化页面上面的按钮事件
            };

            return oInit;
        };

        setInterval(function () {

            if (activeTab == '#shishijilu') {
                queryAll();
                //queryAllLuoSha();
            }
            else if (activeTab == '#dantaijianshi') {
                // 单台监视列表刷新
                $('#dantaijianshitable').jqGrid('setGridParam', {
                    postData: {
                        Action: "initdangtaijianshidata",
                        EquNo: $('#equnolist').find('option:selected').val(),
                        TaiHao: $('#equnolist').find('option:selected').text(),
                        Time: $("#time").text()
                    },
                }).trigger('reloadGrid');
            }

            else if (activeTab == '#cushaji') {
                $('#tb_cushashengchanwancheng').jqGrid('setGridParam', {
                    postData: {
                        Action: "inittb_cushashengchanwancheng",
                        CustomerID: ID,
                        time: $("#time").text()
                    },
                }).trigger('reloadGrid');
            }
        }, 60000);

        //日期框添加默认值
        function setdate() {
            var sd = new Date();
            sd.setDate(sd.getDate() - 1);
            var sy = sd.getFullYear();
            var sm = sd.getMonth() + 1;
            var sdd = sd.getDate();
            if (sm >= 1 && sm <= 9) {
                sm = "0" + sm;
            }
            if (sdd >= 0 && sdd <= 9) {
                sdd = "0" + sdd;
            }

            var ed = new Date();
            ed.setDate(ed.getDate());
            var ey = ed.getFullYear();
            var em = ed.getMonth() + 1;
            var edd = ed.getDate();
            if (em >= 1 && em <= 9) {
                em = "0" + em;
            }
            if (edd >= 0 && edd <= 9) {
                edd = "0" + edd;
            }
            $("#Kaiting_StartTime").val(sy + "-" + sm + "-" + sdd);
            $("#Kaiting_EndTime").val(ey + "-" + em + "-" + edd);

            $("#weishaKaiting_StartTime").val(sy + "-" + sm + "-" + sdd);
            $("#weishaKaiting_EndTime").val(ey + "-" + em + "-" + edd);

            $("#guzhangtongjiStartTime").val(sy + "-" + sm + "-" + sdd);
            $("#guzhangtongjiEndTime").val(ey + "-" + em + "-" + edd);

            $("#weisha_guzhangStartTime").val(sy + "-" + sm + "-" + sdd);
            $("#weisha_guzhangEndTime").val(ey + "-" + em + "-" + edd);
        }


        ////补位 当某个字段不是两位数时补0
        function fnW(str) {
            var num;
            str > 9 ? num = str : num = "0" + str;
            return num;
        }

        function queryAll() {

            $('#tb_cusha').bootstrapTable('refresh', { pageNumber: 1 });
            $('#tb_luoshaparm').bootstrapTable('refresh', { pageNumber: 1 });
            //$('#tb_cusha').bootstrapTable('removeAll');
            //$.ajax({
            //    type: "post",
            //    //url不用说了吧，否则不知道向服务器哪个接口发送并请求
            //    url: '../MFG/MFGCusha.ashx?Action=getshishijilulist&time=' + $("#time").text(),
            //    //async: true,
            //    //超时时间
            //    timeout: 30000,
            //    data: {
            //        CustomerID: ID
            //    },
            //    success: function (data) {
            //        console.log($.parseJSON(data).rows);
            //        var datajson = $.parseJSON(data).rows;
            //        tableData = [];
            //        for (var i = 0; i < datajson.length; i++) {
            //            tableData.push({
            //                //这里也就是data-field的名称，getDate是服务器返回的字段名
            //                EquNo: datajson[i].EquNo,
            //                Banben: datajson[i].Banben,
            //                cushaniandu: datajson[i].cushaniandu,
            //                tongguanzhijing: datajson[i].tongguanzhijing,
            //                zhirongkuandu: datajson[i].zhirongkuandu,
            //                chengxingjiaodu: datajson[i].chengxingjiaodu,
            //                fangshadongcheng: datajson[i].fangshadongcheng,
            //                meicenghoudu: datajson[i].meicenghoudu,
            //                juanraomidu: datajson[i].juanraomidu,
            //                luolazhijing: datajson[i].luolazhijing,
            //                huanxiangcengshu: datajson[i].huanxiangcengshu,
            //                shanghuanxishu: datajson[i].shanghuanxishu,
            //                xiahuanxishu: datajson[i].xiahuanxishu
            //            })
            //        }

            //        $('#tb_cusha').bootstrapTable('append', tableData);
            //    }
            //});
        }

        function queryAllLuoSha() {
            $('#tb_luoshaparm').bootstrapTable('removeAll');
            $.ajax({
                type: "post",
                //url不用说了吧，否则不知道向服务器哪个接口发送并请求
                url: '../MFG/MFGCusha.ashx?Action=getluoshacanshu',
                //async: true,
                //超时时间
                timeout: 30000,
                data: {
                    CustomerID: ID
                },
                success: function (data) {
                    console.log($.parseJSON(data).rows);
                    var datajson = $.parseJSON(data).rows;
                    tableData = [];
                    for (var i = 0; i < datajson.length; i++) {
                        tableData.push({
                            //这里也就是data-field的名称，getDate是服务器返回的字段名
                            EquNo: datajson[i].EquNo,
                            jianianquanshu: datajson[i].jianianquanshu,
                            liutouchangdu: datajson[i].liutouchangdu,
                            pantoufangshi: datajson[i].pantoufangshi,
                            luosahfangshi: datajson[i].luosahfangshi,
                            pantouquanshu: datajson[i].pantouquanshu,
                            zhanglitiaojie: datajson[i].zhanglitiaojie
                        })
                    }

                    $('#tb_luoshaparm').bootstrapTable('append', tableData);
                }
            });
        }

        function alarm(EquNo, AlarmName) {
            //var keyValue = $("#gridTable").jqGridRowValue("EquNo");
            //var AlarmName = $("#gridTable").jqGridRowValue("AlarmName");
            dialogOpen({
                id: "Form",
                title: '报警信息故障排查-' + EquNo,
                url: '../MFG/AlarmPaicha.html?equno=' + EquNo + '&AlarmName=' + encodeURIComponent(AlarmName),
                width: "600px",
                height: "500px",
                btn: null
            });
        }

        /*

   * ajax 函数，处理 ajax 请求

   * @param function callback 回调函数

   * @因为要和服务器交互，所以必须在服务器环境运行，不能在硬盘上直接打开

  */

        function ajax(callback) {

            if (typeof callback != 'function') return;

            var ajaxObject;

            try {

                ajaxObject = new XMLHttpRequest();

            } catch (e) {

                try {

                    ajaxObject = new ActiveXObject('Microsoft.XMLHTTP');

                } catch (e) {

                }

            }

            if (!ajaxObject) return;

            if (ajaxObject.overrideMimeType) {

                ajaxObject.overrideMimeType('text/html');

            }

            //location.href可以换成其他url，但必须是同一个站点的链接，并且文件存在

            ajaxObject.open('get', location.href);

            ajaxObject.send(null);

            ajaxObject.onreadystatechange = function () {

                if (ajaxObject.readyState == 4) {

                    if (ajaxObject.status == 200) {

                        callback(ajaxObject);

                    }

                }

            };

        }

        /*

         * 获取时间并动态刷新

        */

        function getTime() {

            ajax(

                function (ao) {

                    //只需要AJAX一次，将服务器时间获取后以毫米为单位保存到一个变量中

                    _timestamp = Date.parse(ao.getResponseHeader('Date'));

                    _timestamp = _timestamp.toString().match(/^\d$/) ? _timestamp : new Date().getTime();

                    //设置定时器每过一秒动态刷新一次时间

                    setInterval(

                        function () {

                            //这里可以自定义时间显示格式

                            //document.getElementById('time').innerHTML = new Date(_timestamp)
                            var oDiv = document.getElementById("time");
                            var date = new Date(_timestamp);
                            var year = date.getFullYear();//当前年份
                            var month = date.getMonth();//当前月份
                            var data = date.getDate();//天
                            var hours = date.getHours();//小时
                            var minute = date.getMinutes();//分
                            var second = date.getSeconds();//秒
                            var time = year + "-" + fnW((month + 1)) + "-" + fnW(data) + " " + fnW(hours) + ":" + fnW(minute) + ":" + fnW(second);
                            oDiv.innerHTML = time;
                            _timestamp += 1000;

                        },

                        1000

                    );

                }

            );

        }


        function externallinks() {
            if (!document.getElementsByTagName) return;
            var anchors = document.getElementsByTagName("a");
            for (var i = 0; i < anchors.length; i++) {
                var anchor = anchors[i];
                if (anchor.getAttribute("href"))
                    anchor.target = "_blank";
            }
        }
        //window.onload = externallinks;
        //window.onload = getTime;
    </script>

</body>

</html>
